package com.jsb.laundry.controller;

import com.jsb.laundry.common.response.WebResponse;
import com.jsb.laundry.config.properties.AliOSSUtil;
import com.jsb.laundry.model.dto.RidersTakePhotosAndUploadPicturesRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = {"上传图片"})
@RestController
@RequestMapping("/update/")
public class UpdateImgController {
    @ApiOperation(value = "骑手批量上传图片", notes = "骑手上传图片", httpMethod = "POST")
    @PostMapping("ridersTakePhotosAndUploadPictures")
    public WebResponse ridersTakePhotosAndUploadPictures(@RequestBody RidersTakePhotosAndUploadPicturesRequest ridersTakePhotosAndUploadPicturesRequest){

        return WebResponse.successData(1);
    }
    @ApiOperation(value = "骑手上传图片", notes = "骑手上传图片", httpMethod = "POST")
    @PostMapping("add")
    public WebResponse add(@RequestParam(value = "file") MultipartFile file){
        String laundry = AliOSSUtil.uploadFile(file, "laundry");
        return WebResponse.successData(laundry);
    }
}
